package net.janeluo.rs.module;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import net.janeluo.rs.entity.RS_Orders;
import net.janeluo.rs.entity.RS_User;
import net.janeluo.rs.service.OrdersListService;
import net.janeluo.rs.service.PersonalCenterService;

import org.apache.commons.lang.StringUtils;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;

/**
 * 个人中心模块
 * 
 * @author DLK)JaneLuo
 * @version 1.0.0
 */
@IocBean
@At("/")
public class PersonalCenterModule {

    @Inject
    private PersonalCenterService personalCenterService;
    
    /**
     * 初始化显示订单列表
     * @return 
     * @return 
     */
    @At("PersonalCenter")
    @Ok("jsp:views.PersonalCenter")
    public Map<String, Object> initOrdersList(HttpServletRequest req, @Param("year")String year, @Param("month")String month,@Param("day")String day){
        req.getSession().setAttribute("menuName", "PersonalCenter");
        RS_User userInfo = (RS_User) req.getSession().getAttribute("user");
        return personalCenterService.initPersonalCenter(userInfo.getUserid());
    }

}
